package com.shangxia.feign.client;

import com.shangxia.feign.client.fallBack.ProductClientFallBackFactory;
import com.shangxia.feign.model.SX_Product;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.*;

import java.util.List;

/**
 * @author zhouya24
 * @date 2021/11/18 15:26
 * @apiNote ProductClient
 */
@FeignClient(value = "productservice", fallbackFactory = ProductClientFallBackFactory.class)
@RequestMapping("/product/product")
public interface ProductClient {


    @GetMapping("/{id}")
    public SX_Product queryById(@PathVariable("id") Long id);

    @PostMapping("/ids")
    List<SX_Product> listByIds(@RequestParam("ids") String ids);

    @PostMapping("/list")
    List<SX_Product> listByIds(@RequestBody() List<Long> ids);
}
